﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MusicStore.Models
{
    public class Register//注册
    {
        [Required(ErrorMessage = "用户名为非空字段！")]//非空字段
        [DisplayName("用户名：")]
        [StringLength(160)]//长度
        [Key]
        public string  UserId { get; set; }//自动属性 

        [DataType(DataType.Password)]//不可视
        [Required(ErrorMessage = "密码为非空字段！")]//非空字段
        [DisplayName("密码：")]
        [StringLength(20, MinimumLength = 6)]
        public string PassWord { get; set; }

        [DataType(DataType.Password)]//不可视
        [Required(ErrorMessage = "密码为非空字段！")]//非空字段
        [DisplayName("密码确认：")]
        [Compare("PassWord", ErrorMessage ="密码不一致！")]
        [StringLength(20, MinimumLength = 6)]
        public string PassWordsConfirmation { get; set; }//密码确认 
       
    }
}